package org.flowcircuit.appearance


import java.awt.Color
import model.coordinates.{Dim, PosDir, Pos}
/**
 * Surface to render 2D appearance on.
 * 
 * @author Hans Haggstrom
 */
// TODO: Move these to appearance subclasses, so that they can be composed and the compositions saved.
// It would also encapsulate rendering and hit-testing better.
abstract class DrawContext {

  def circle( center : Pos,  diameter : Float, style : Style )
  def rectangle( topLeft : Pos,  dimension : Dim, style : Style )
  def line( start : Pos, end : Pos, style : Style )
  def line( start : Pos, end : Pos, width : Float, style : Style )
  def spline( start : PosDir, end : Pos, style : Style )


  def isInsideCircle( queryPos : Pos, center : Pos,  diameter : Float, style : Style ) : Boolean
  def isInsideRectangle( queryPos : Pos, topLeft : Pos,  dimension : Dim, style : Style ) : Boolean
  def isInsideLine( queryPos : Pos, start : Pos, end : Pos, style : Style ) : Boolean
  def isInsideLine( queryPos : Pos, start : Pos, end : Pos, width : Float, style : Style ) : Boolean
  def isInsideSpline( queryPos : Pos, start : PosDir, end : Pos, style : Style ) : Boolean


  def project( basePosDir : PosDir ) : DrawContext
  def project( x : Float, y : Float, scale : Float ) : DrawContext

}